import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/base/scheduleJob/list',
    method: 'get',
    params: query
  })
}

export function createScheduleJob(sheduleJob) {
  return request({
    url: '/base/scheduleJob/create',
    method: 'post',
    data: sheduleJob
  })
}

export function updateScheduleJob(sheduleJob) {
  return request({
    url: '/base/scheduleJob/update',
    method: 'post',
    data: sheduleJob
  })
}

export function deleteScheduleJob(jobId) {
  return request({
    url: '/base/scheduleJob/delete',
    method: 'post',
    params: { jobId }
  })
}

export function executeScheduleJob(jobId) {
  return request({
    url: '/base/scheduleJob/execute',
    method: 'post',
    params: { jobId }
  })
}
